package com.WISSC.serviceImpl;

import com.WISSC.bean.Bootstrap;
import com.WISSC.mapper.BootstrapMapper;
import com.WISSC.service.BootstrapService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.sf.ehcache.search.expression.Criteria;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * bootstrap测试 服务实现类
 * </p>
 *
 * @author 张凯
 * @since 2019-05-13
 */
@Service
public class BootstrapServiceImpl extends ServiceImpl<BootstrapMapper, Bootstrap> implements BootstrapService {

    //1.查询所有员工信息
    public List<Bootstrap> getAll() {
        Bootstrap ee=new Bootstrap();
        return baseMapper.selectByExampleWithDept(ee);
    }

    //2.向数据库中插入数据
    public void saveEmp(Bootstrap bootstrap){
        baseMapper.insertSelective(bootstrap);
    }

    //4.校验
    /*public boolean checkUser(String name) {
        Bootstrap bootstrap=new Bootstrap();
        Criteria cri=bootstrap.createCriteria();
        cri.andEmpNameEqualTo(empName);
        //查询是否有此对象
        int count=(int) employeeMapper.countByExample(example);
        //哈哈，绝了
        return count==0;
    }*/

}
